/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gob.cgr.sgrh.ejb.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author MICROSOF
 */
@Entity
@Table(name = "condicion_estudio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CondicionEstudio.findAll", query = "SELECT c FROM CondicionEstudio c"),
    @NamedQuery(name = "CondicionEstudio.findByIdCondEstudio", query = "SELECT c FROM CondicionEstudio c WHERE c.idCondEstudio = :idCondEstudio"),
    @NamedQuery(name = "CondicionEstudio.findByCodigo", query = "SELECT c FROM CondicionEstudio c WHERE c.codigo = :codigo"),
    @NamedQuery(name = "CondicionEstudio.findByDenominacion", query = "SELECT c FROM CondicionEstudio c WHERE c.denominacion = :denominacion"),
    @NamedQuery(name = "CondicionEstudio.findByTipoEstudio", query = "SELECT c FROM CondicionEstudio c WHERE c.tipoEstudio = :tipoEstudio"),
    @NamedQuery(name = "CondicionEstudio.findBySubtipoEstudio", query = "SELECT c FROM CondicionEstudio c WHERE c.subtipoEstudio = :subtipoEstudio")})
public class CondicionEstudio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_COND_ESTUDIO")
    private Integer idCondEstudio;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CODIGO")
    private String codigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "DENOMINACION")
    private String denominacion;
    @Size(max = 45)
    @Column(name = "TIPO_ESTUDIO")
    private String tipoEstudio;
    @Size(max = 45)
    @Column(name = "SUBTIPO_ESTUDIO")
    private String subtipoEstudio;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCondEstudio")
    private List<EstudioProfesional> estudioProfesionalList;

    public CondicionEstudio() {
    }

    public CondicionEstudio(Integer idCondEstudio) {
        this.idCondEstudio = idCondEstudio;
    }

    public CondicionEstudio(Integer idCondEstudio, String codigo, String denominacion) {
        this.idCondEstudio = idCondEstudio;
        this.codigo = codigo;
        this.denominacion = denominacion;
    }

    public Integer getIdCondEstudio() {
        return idCondEstudio;
    }

    public void setIdCondEstudio(Integer idCondEstudio) {
        this.idCondEstudio = idCondEstudio;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getDenominacion() {
        return denominacion;
    }

    public void setDenominacion(String denominacion) {
        this.denominacion = denominacion;
    }

    public String getTipoEstudio() {
        return tipoEstudio;
    }

    public void setTipoEstudio(String tipoEstudio) {
        this.tipoEstudio = tipoEstudio;
    }

    public String getSubtipoEstudio() {
        return subtipoEstudio;
    }

    public void setSubtipoEstudio(String subtipoEstudio) {
        this.subtipoEstudio = subtipoEstudio;
    }

    @XmlTransient
    public List<EstudioProfesional> getEstudioProfesionalList() {
        return estudioProfesionalList;
    }

    public void setEstudioProfesionalList(List<EstudioProfesional> estudioProfesionalList) {
        this.estudioProfesionalList = estudioProfesionalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCondEstudio != null ? idCondEstudio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CondicionEstudio)) {
            return false;
        }
        CondicionEstudio other = (CondicionEstudio) object;
        if ((this.idCondEstudio == null && other.idCondEstudio != null) || (this.idCondEstudio != null && !this.idCondEstudio.equals(other.idCondEstudio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gob.cgr.sgrh.ejb.entidad.CondicionEstudio[ idCondEstudio=" + idCondEstudio + " ]";
    }
    
}
